#include"BinaryTree.h"
BTree* BuyNode(BinaryTreeData x)
{
	BTree* newnode = (BTree*)malloc(sizeof(BTree));
	if (newnode == NULL)
	{
		perror("malloc fail");
		return NULL;
	}
	newnode->val = x;
	newnode->left = NULL;
	newnode->right = NULL;
	return newnode;
}
void DestoryBTree(BTree* root)
{
	if (root == NULL)
		return;
	DestoryBTree(root->left);
	DestoryBTree(root->right);
	free(root);
}